<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>天高智慧</title>
<link href="./res/style/main.css?r=<?php echo rand(); ?>" rel="stylesheet" type="text/css" />
<link href="./res/style/index.css?r=<?php echo rand(); ?>" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="./res/script/jquery-1.4.2.min.js"></script>
<script language="javascript" type="text/javascript" src="./res/script/common.js"></script>
<?php $this->listScript(); ?>
<script>
/** AUKEY Defined **/
AUKEY = 'cevin';
/** defeins **/
INPUT_POST = <?php echo $this->input_post; ?>;
INPUT_GET = <?php echo $this->input_get; ?>;

Array.prototype.removeByIndex = function(i){
  if (i < this.length && i >= 0) {
      var ret = this.slice(0, i).concat(this.slice(i + 1));
      this.length = 0;
      this.push.apply(this, ret);
  }
}
Array.prototype.getIndexByVal = function (val){
    var tmp = this;
    for (var i=0;i<tmp.length ;i++ )
    {
        if(tmp[i]==val) {
            return i;
        }
    }
}

function dialogMessage(text,color){
    var dialog = $('#loading');
    dialog.css('background',color);
    dialog.html(text);
    dialog.show();
    dialog.fadeOut(2000);
}

function switchTab(obj,tab_name) {
}

$.ajaxSetup({
    cache:false,
    beforeSend:function() {
        var dialog = $('#loading');
        dialog.html('请稍等');
        dialog.css('background','yellow');
        dialog.show();
    },
    complete:function(xhr,state){
        var dialog = $("#loading");
        if ('parsererror' == state)
        {
            dialogMessage('Error:01','red');
            return false;
        }
        dialog.fadeOut(2000);
    },
    success:function(data){
        if (data.state <= 0)
        {
            alert(data.message);
            return false;
        }
        dialogMessage(data.message,'green');
    }
});

$(function(){
    $('input[type=checkbox][checkfor]').click(function() {
        var checklabel = $(this).attr('checkfor');
        var chks =  $('input[type=checkbox][checklabel='+checklabel+']');
        if ($(this).attr('checked'))
        {
            chks.attr('checked','true');
        }
        else
        {
            chks.removeAttr('checked');
        }
    });
    $('img[href]').click(function(){
        location.href=$(this).attr('href');
    });
});
</script>
</head>

<body>
<?php if (!AJAX): ?>
<div id='loading' style="display:none;width:auto;height:20px;background:red;padding:5px;font-weight:bold;font-family:'黑体';font-size:15px;position:fixed;left:5px;top:0;">请稍等...</div>
<?php endif; ?>
<div class="main_td">
<?php if (!AJAX): ?>
<div class="page_now">
      <div class="fl"><a href="javascript:;">天高智慧管理中心</a><a href="javascript:;"><?php echo $this->menu_name; ?></a><a href="javascript:;"><?php echo $this->menu_group_name; ?></a><span><?php echo $this->node_name; ?></span></div>
      <div class="fr"><?php echo $this->headlink; ?></div>
</div>
<div class="line_1"></div>
<?php endif; ?>
<?php $this->render($this->load_tpl); ?>
<div id="ymessage" style="position: fixed; padding-right:10px; right: 10px; background-color: black; color: red; font-size: 18px; "></div>
<!-- 实时提醒 --->
<script>

cnoh = '';
function checknotice() {
    $.post('?app=portal&mod=cno',{r:Math.random()},function(data){
        if (data.state > 0)
        {
			$('#ymessage').html(data.message).css('bottom','-'+$('#ymessage').height()+2+'px');
			$('#ymessage').animate({bottom:'0px'},4000);
			clearInterval(cnoh);
        }
    },'json');
}
cnoh = setInterval('checknotice()',60000);

</script>
</body>
</html>
